package com.lzx.answer.controller.web;

import com.lzx.answer.entity.GiveALike;
import com.lzx.answer.service.GiveALikeService;
import com.lzx.common.utils.R;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/answer/giveALike/web")
public class WebGiveALikeController {
    @Resource
    private GiveALikeService giveALikeService;

    //从关联表获取当前用户点赞的数据
    @GetMapping("/getUserGiveALikeListById/{userId}")
    public R getUserGiveALikeListById(@PathVariable Integer userId){
        return giveALikeService.getUserGiveALikeListById(userId);
    }

    //点赞问题
    @PostMapping("/like")
    public R like(@RequestBody GiveALike giveALike){
        return giveALikeService.like(giveALike);
    }
}
